cd "____________"
version 15
use "./data/pm10data.dta", clear
qui keep if id==7  // Use only Beijing data
by year, sort: egen good=mean(pmconc<=float(0.05))
by year, sort: egen bluesky=mean(pmconc<=float(0.15))
by year, sort: egen bad=mean(pmconc>float(0.35))
replace good=round(good,0.01)
replace bluesky=round(bluesky,0.01)
replace bad=round(bad,0.01)
local cityname=city[1] 
twoway (connected good year, mlabel(good) mlabposition(1)) (connected bluesky year, mlabel(bluesky) mlabposition(1)) ///
(connected bad year, mlabel(bad) mlabposition(6)), ///
xlabel(2001(1)2010) graphregion(color(white)) title("`cityname': 2001-2010") ///
legend(order(1 "Prop. of Excellent Days" 2 "Prop. of Blue-sky Days" ///
3 "Prop. of Very Unhealthy Days ")) 
graph export "./outputgraphs/main/Figure1.pdf", replace
